#pragma once

#include "Sol9Types.h"
#include "radian.h"
#include "degree.h"

namespace sol9
{
namespace core
{

	enum eAngleUnit
	{
		EAU_Unknown,
		EAU_Radian,
		EAU_Degree,
	};

	class angle
	{
	private:
		f32 a;
		eAngleUnit u;

	public:
		// constructor
		angle() : a(0.0f), u(EAU_Unknown) {}

		explicit angle(f32 angle, eAngleUnit unit = EAU_Unknown) : a(angle), u(unit) {}

		//angle(const radian& radians) : a(radians), u(EAU_Radian) {}

		//angle(const degree& degrees) : a(degrees), u(EAU_Degree) {}

		// operators
		operator radian() const
		{
			if (u == EAU_Degree)
				return radian(core::rad2deg(a));
			else
				return radian(a);
		}

		operator degree() const
		{
			if (u == EAU_Radian)
				return degree(core::deg2rad(a));
			else
				return degree(a);
		}

		// functions
		eAngleUnit getAngleUnit()
		{
			return u;
		}
	};

} // namespace core
} // namespace sol9